cmake_minimum_required(VERSION 3.8)
project(separate_args)

#separate_arguments(res1 UNIX_COMMAND "param1 param2")
#separate_arguments(res2 WINDOWS_COMMAND "param1 param2")
#separate_arguments(res3 NATIVE_COMMAND "param1 param2")

#separate_arguments(res1 UNIX_COMMAND "\"param1 param2\"")
#separate_arguments(res2 WINDOWS_COMMAND "\"param1 param2\"")
#separate_arguments(res3 NATIVE_COMMAND "\"param1 param2\"")

#separate_arguments(res1 UNIX_COMMAND "\'param1 param2\'")
#separate_arguments(res2 WINDOWS_COMMAND "\'param1 param2\'")
#separate_arguments(res3 NATIVE_COMMAND "\'param1 param2\'")

separate_arguments(res1 UNIX_COMMAND "backslash\\\\ \"double quote\" \'single quote\' \\\"escape-double-quote \\\'escape-single-quote param1 param2")
separate_arguments(res2 WINDOWS_COMMAND "backslash\\\\ \"double quote\" \'single quote\' \\\"escape-double-quote \\\'escape-single-quote param1 param2")
separate_arguments(res3 NATIVE_COMMAND "backslash\\\\ \"double quote\" \'single quote\' \\\"escape-double-quote \\\'escape-single-quote param1 param2")

message(STATUS "res1 = ${res1}")
message(STATUS "res2 = ${res2}")
message(STATUS "res3 = ${res3}")
